<%--
  Created by IntelliJ IDEA.
  User: 6哥
  Date: 2020/10/22
  Time: 20:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="commons/header.jsp"%>

<table id="DataTable" class="table table-bordered table-striped"></table>

<%@ include file="commons/footer.jsp"%>
<script>

    $('#DataTable').bootstrapTable({
        url: '${pageContext.servletContext.contextPath}/order/ProcessLog',
        method: 'GET',
        columns: [
            // field是返回rows中每个对象的属性名
            // {title: 'ID',filed:'id'},
            {title: '用户名',field:'userName'},
            // {title: '全类名',filed: 'className'},
            {title: '方法名称',field:'methodName'},
            {title: '操作信息',field:'processInfo'},
            {title: '参数信息',field:'paramsInfo'},
            {title: '操作时间',field:'createTime',formatter: formatTime},

        ],
        sidePagination: 'server',
        pagination: true, //表示使用分页
        pageList: [5,10,20]

    })
        /**
         * 决定了在哪边分页：client server, 两种不同的配置决定了服务器端返回的数据格式。
         *  client分页, 服务器端返回的数据  [{}, {}, {}]
         *  server端分页，服务器端返回的数据：{rows:[{}, {}], total: 23}
         */

    // 格式化日期
    function formatTime(value) {
        return moment(value).format('YYYY-MM-DD HH:mm:ss')
    }


</script>
